/*
 * This file is part of ksPlatform
 * 
 * Copyright (c) 2014-2015
 * 
 * This file is dual-licensed under the AGPLv3 (http://www.gnu.org/licenses/agpl-3.0.html) 
 * 
 * If you are unsure which license is appropriate for your use, please contact the sales department
 * at 97041437@qq.com.
 */
package cn.com.ksplatform.core.expand.spring.hibernate4;

import java.io.IOException;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.com.ksplatform.common.util.SystemStatu;
import cn.com.ksplatform.core.context.PlatformContext;

public class OpenSessionInViewFilter extends org.springframework.orm.hibernate4.support.OpenSessionInViewFilter{

	@Override
	protected void doFilterInternal(HttpServletRequest arg0,
			HttpServletResponse arg1, FilterChain arg2)
			throws ServletException, IOException {
		if(PlatformContext.SYSTEMSTATU.equals(SystemStatu.INSTALLED)){
			super.doFilterInternal(arg0, arg1, arg2);
		}else{
			arg2.doFilter(arg0, arg1);
		}
	}
	
}
